package cn.funeralobjects.upms.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * 用户拥有角色实体对象
 *
 * @author FuneralObjects
 * Create date: 2019-08-10 15:41
 */
@Entity
@Table(name = "t_user_role")
@Data
@Accessors(chain = true)
@IdClass(EUserRole.class)
@EqualsAndHashCode
public class EUserRole implements Serializable {
    /**
     * 用户id [ref -> User.id]
     * {@link EUser#getId()}
     */
    @Id
    private Integer userId;
    /**
     * 角色ID集合 [ref -> Role.id]
     * {@link ERole#getId()}
     */
    @Id
    private Integer roleId;
}
